/*
	File:		CreateEnemyMessage.cpp
	Course:		SGD 1301
	Author:		Peter Nguyen
	Purpose:	Message to create a Enemy entity
*/

#include "CreateEnemyMessage.h"

#include "AIShip.h"
#include "../SGD Wrappers/SGD_Math.h"

////////////////////////////////////////////////////////////
// CONSTRUCTOR
CCreateEnemyMessage::CCreateEnemyMessage(CEntity* target)
	: CMessage( MSG_CREATE_ENEMY )
{
	m_pTarget = target;
	m_pTarget->AddRef();
}


////////////////////////////////////////////////////////////
// DESTRUCTOR
CCreateEnemyMessage::~CCreateEnemyMessage(void)
{
	m_pTarget->Release();
	m_pTarget = nullptr;
}

////////////////////////////////////////////////////////////
// CreateLaser	- create a mostly-functional laser entity
//				  using the message's data members
//				- return the laser upcasted to CEntity*
CEntity* CCreateEnemyMessage::CreateEnemy( void ) const
{
	CAIShip* pShip = new CAIShip();
	pShip->SetTarget(m_pTarget);
	pShip->SetPosX(m_pTarget->GetPosX());
	pShip->SetPosY(m_pTarget->GetPosY());
	pShip->SetWidth(100);
	pShip->SetHeight(100);





	return (CEntity*)pShip;
}
